﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Phys.Model.Affectors {
	public class RotatorAffector : IAffector {
		/// <summary>
		/// The rotation angle in Degrees which is applied in every second
		/// </summary>
		public double Angle { get; set; }

		/// <summary>
		/// Constructs a RotateAffector which rotates the object around the Y axis by a full circle every second
		/// </summary>
		public RotatorAffector() : this(360) { }
		public RotatorAffector(double angle) { Angle = angle; }

		public void Affect(IObject o, double seconds) {
			if (o is RectObject) {
				RectObject r = (RectObject)o;
				r.Rotation += Angle * seconds;
			}
		}

	}
}
